package com.czh.intelligentoj.common;

import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.digest.DigestAlgorithm;
import cn.hutool.crypto.digest.Digester;

import java.util.HashMap;
import java.util.Map;

/**
 * 认证签名工具类
 */
public class SignUtils {
    /**
     * 内容加密
     * @param body
     * @param secretkey
     * @return
     */
    public static String getSign(String body, String secretkey) {
        Digester digester = new Digester(DigestAlgorithm.SHA256);
        String content = body.toString()  + "." + secretkey;
        return digester.digestHex(content);
    }


}
